<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="/layui/css/layui.css" />
</head>
<body>
<div style="margin:10px;">
    <!--搜索-->
    <div style="margin-top: 20px;">
        <form class="layui-form layui-form-pane" action="">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">标题/小编</label>
                    <div class="layui-input-inline">
                        <input type="text" name="number" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">日期</label>
                    <div class="layui-input-inline">
                        <input type="text" name="date" id="date" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this})">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">栏目</label>
                    <div class="layui-input-inline">
                        <select name="type">
                            <option value="">请选择栏目</option>
                            <option value="1">头条</option>
                            <option value="0">今日黄石</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-inline">
                        <select name="type">
                            <option value="">请选择状态</option>
                            <option value="1">已发布</option>
                            <option value="0">新创建</option>
                            <option value="0">待审核</option>
                            <option value="0">待修改</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn">搜索</button>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn  layui-btn-normal">清空</button>
                </div>
            </div>
        </form>
    </div>
    <table class="layui-table layui-form">
        <colgroup>
            <col width="10">
            <col width="50">
            <col width="400">
            <col width="100">
            <col width="100">
            <col width="150">
            <col width="80">
            <col width="100">
            <col width="100">
            <col width="100">
            <col width="300">
        </colgroup>
        <thead>
        <tr>
            <th><input type="checkbox" lay-skin="primary" lay-filter="allChoose" data-id="1" /></th>
            <th>编号</th>
            <th>标题</th>
            <th>栏目</th>
            <th>类型</th>
            <th>最后更新时间</th>
            <th>状态</th>
            <th>小编</th>
            <th>来源</th>
            <th>是否置顶</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>76788</td>
            <td><a href="newsList.html">四川发生校园暴力事件：女生35秒被掌掴14次</a></td>
            <td>头条</td>
            <td>单图</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>是</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal" onclick="edit(this);">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>76787</td>
            <td><a href="newsList.html">【GIF】重庆一小偷行窃后翻窗逃跑 公交司机奋勇擒贼</a></td>
            <td>黄石</td>
            <td>视频直播</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>否</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>176789</td>
            <td><a href="newsList.html">大冶湖特大桥开始刷黑</a></td>
            <td>头条</td>
            <td>图文直播</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>否</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>176789</td>
            <td><a href="newsList.html">大冶湖特大桥开始刷黑</a></td>
            <td>头条</td>
            <td>图文直播</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>否</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>176789</td>
            <td><a href="newsList.html">大冶湖特大桥开始刷黑</a></td>
            <td>头条</td>
            <td>图文直播</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>否</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>176789</td>
            <td><a href="newsList.html">大冶湖特大桥开始刷黑</a></td>
            <td>头条</td>
            <td>图文直播</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>否</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>176789</td>
            <td><a href="newsList.html">大冶湖特大桥开始刷黑</a></td>
            <td>头条</td>
            <td>图文直播</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>否</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>176789</td>
            <td><a href="newsList.html">大冶湖特大桥开始刷黑</a></td>
            <td>头条</td>
            <td>图文直播</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>否</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>176789</td>
            <td><a href="newsList.html">大冶湖特大桥开始刷黑</a></td>
            <td>头条</td>
            <td>图文直播</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>否</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        <tr>
            <td><input type="checkbox" lay-skin="primary" lay-filter="oneChoose" data-id="1" /></td>
            <td>176789</td>
            <td><a href="newsList.html">大冶湖特大桥开始刷黑</a></td>
            <td>头条</td>
            <td>图文直播</td>
            <td>2017-04-03 16:04</td>
            <td>已发布</td>
            <td>小王</td>
            <td>东楚晚报</td>
            <td>否</td>
            <td >
                <button class="layui-btn layui-btn-small layui-btn-normal">编辑</button>
                <button class="layui-btn layui-btn-small layui-btn-normal">撤销</button>
                <button class="layui-btn layui-btn-small">查看评论</button>
            </td>
        </tr>
        </tbody>
    </table>
</div>
<div style="margin-left: 10px;margin-top: 30px;margin-right: 1px;">
    <!--按钮组-->
    <div class="layui-btn-group" style="float: left;">
        <button class="layui-btn layui-btn-normal" onclick="addNews();">新建</button>
        <button class="layui-btn layui-btn-danger">删除</button>
        <button class="layui-btn layui-btn-normal">推送</button>
        <button class="layui-btn layui-btn-normal">加入专题</button>
        <button class="layui-btn layui-btn-warm">添加置顶</button>
        <button class="layui-btn layui-btn-danger">关闭评论</button>
        <button class="layui-btn">开启评论</button>
    </div>
    <!--分页-->
    <div id="tablePage" style="float: right">
    </div>
</div>

<script type="text/javascript" src="/layui/jquery-3.2.0.min.js"></script>
<script type="text/javascript" src="/layui/layui.js"></script>
<script>
    layui.use(['element','form','laypage', 'laydate','layer'], function() {
        var $ = layui.jquery,
            element = layui.element,
            form = layui.form(),
            laypage = layui.laypage,
            layer = layui.layer;
        laypage({
            cont: 'tablePage',
            pages: 100,
            skip: true
        });
    });

    function edit(btn) {
        var parent = $(btn).parent().parent();
        var id = parent.children('td').eq(1).text();
        var title = parent.children('td').eq(2).text();
        layer.open({
            title:'编辑新闻: '+title,
            type:2,
            content: "/news/newsEdit.html",
            area: ['100%','100%']
        });
    }

    function addNews() {
        layer.open({
            title:'添加新闻',
            type:2,
            content: "/news/newsEdit.html",
            area: ['100%','100%']
        });
    }

</script>
</body>
</html>